SOFTWARE & HARDWARE DESCRIPTION * Complete CMX868-based V.22bis modem design * Ultra-low power * RS232 host interface * AT command set * Host C * Two DAA / line interface variations * `North American' * European / global * `Ready' for CTR21 and FCC Part 68 APPLICATION NOTE CMX868 & CMX867 V.22bis/V.22 Modem Design Guide * Modem Design Guide * Reduces development time and risk * Documented C Source code * Supports easy user adaptation for specific designs * Complete schematics * Bills of Materials RS-232 level shifter Polarity Protected DC Voltage Regulator Host C Line State Detection Hook Switch CMX868 V.22bis Modem Line Transformer Ring Isolation RS-232 port +5V common Protection COMMUNICATION SEMICONDUCTORS tip ring Gyrator (CTR21 only) DAA / line interface The CMX868 & CMX867 V.22bis/V.22 Modem Design Guide supports rapid development and manufacture of ultra-low power CMX868-based V.22bis and CMX867-based V.22 modems. This design has been optimized for a variety of applications including set top boxes, point-of-sale (POS) terminals and security systems. Providing a full set of modem functions the design guide includes the following: CMX868 2400bps full duplex V.22bis modem IC, MSP430 low power microcontroller, RS-232 asynchronous serial host interface, AT command set, FCC and CTR21 telephone line interface (both are provided), DC power supply, and microcontroller C source code. For applications requiring only 1200bps full duplex V.22 operation a user can readily adapt the design and use a CMX867 device in place of the provided CMX868. The design is for realistic wireline applications and the telephone line interface portion of the circuit is expected to achieve FCC Part 68 and CTR21 approvals when implemented in an appropriate board layout. (Board layout guidelines are provided.) These designs were completed in conjunction with International Data Communications (Fremont, CA, www.idc-us.com). 2001 MX-COM, Inc. www.mxcom.com Tel: 800 638 5577 336 744 5050 Fax: 336 744 5054 4800 Bethania Station Road, Winston-Salem, NC 27105-1201 USA Doc. # 208300157.002 All trademarks and service marks are held by their respective companies. Software & Hardware Description 2 of 24 CMX868 & CMX867 Modem Design Guide Table Of Contents Section Page 1. Introduction ....................................................................................................................3 1.1 Support for CMX868 and CMX867 Devices.........................................................................3 1.2 Support for FCC Part 68 and CTR21 ...................................................................................3 1.3 CMX868 ...............................................................................................................................3 1.4 CMX867 ...............................................................................................................................4 2. Hardware ........................................................................................................................4 2.1 Introduction ..........................................................................................................................4 2.2 Telephone Line State Detection ...........................................................................................5 2.2.1 On/Off Hook Detect Operation ................................................................................................5 2.2.2 Intrusion / E911 Detect Operation...........................................................................................5 2.3 Host Processor and CMX868...............................................................................................5 2.4 Line Interface Circuit (DAA)..................................................................................................5 2.4.1 `FCC Circuit' ............................................................................................................................6 2.4.2 `CTR21 Circuit' ........................................................................................................................6 2.4.3 Differences between `FCC' and `CTR21' Circuits ...................................................................6 3. Schematics .....................................................................................................................7 4. BOMs - Bills Of Materials ...........................................................................................11 5. Firmware.......................................................................................................................15 5.1 Compiler Switches..............................................................................................................15 5.2 Firmware Modes.................................................................................................................16 5.3 Interrupts ............................................................................................................................17 5.4 Timers ................................................................................................................................17 5.5 Source Code Functions......................................................................................................17 5.6 Basic AT Commands..........................................................................................................19 5.7 CMX868 Specific AT Commands.......................................................................................21 5.8 S Registers.........................................................................................................................22 MX-COM, Inc. assumes no responsibility for the use of any circuitry described. No IPR or circuit patent licenses are implied. MX-COM, Inc. reserves the right to change the said circuitry and this document at any time and without notice. 2001 MX-COM, Inc. www.mxcom.com Tel: 800 638 5577 336 744 5050 Fax: 336 744 5054 4800 Bethania Station Road, Winston-Salem, NC 27105-1201 USA Doc. # 208300157.002 All trademarks and service marks are held by their respective companies. Software & Hardware Description 1. 3 of 24 CMX868 & CMX867 Modem Design Guide Introduction This V.22bis modem design guide is based on the CMX868 V.22bis modem IC. It includes an RS232 serial port host interface and an AT command set for convenient operation in a variety of embedded and standalone applications. 1.1 Support for CMX868 and CMX867 Devices The CMX867 and CMX868 are multi-standard modem ICs, identical with the exception that the CMX867 does not support 2400bps V.22bis signaling. This allows 1200bps V.22 designs to be created using the CMX867 and later upgraded via simple modification to support faster V.22bis signaling using the CMX868, if desired. This design guide focuses on the CMX868 and includes V.22bis specific firmware for user convenience. If desired, a user may create a V.22 modem design from this design by replacing the CMX868 with a CMX867 and removing V.22bis specific firmware. 1.2 Support for FCC Part 68 and CTR21 FCC Part 68 and CTR21 are regulatory standards that modem designs must often satisfy. While CTR21 designs generally can satisfy FCC Part 68 requirements they can include components that are not necessary for FCC-only applications. This design guide includes schematics and bills of materials for both `CTR21' and `FCC' type designs. Please refer to these regulations for detailed descriptions of their requirements. 1.3 CMX868 Features Applications * V.22bis 2400/2400bps QAM * Cable TV Set Top Box (STB) * V.22, Bell 212A 1200/1200 or 600/600bps DPSK * Telephone Telemetry Systems * V.23 1200/75, 1200/1200, 75, 1200bps FSK * Remote Utility Meter Reading * Bell 202 1200/150, 1200/1200, 150, 1200bps FSK * Security Systems * V.21 or Bell 103 300/300bps FSK * Industrial Control Systems * DTMF/Tones Transmit and Receive * Electronic Cash Terminals * Extremely Low Power: 3.5mA/3V, 6.5mA/5V typical * Pay-Phones * Modem Links with Caller ID * LINE `Powersave' Standby Mode LINE INTERFACE TX USART & SCRAMBLER. QAM / DPSK / FSK MODULATOR. TONE / DTMF GENERATOR. RX DESCRAMBLER & USART, QAM / DPSK / FSK RECEIVER. TONE / DTMF DETECTOR. CMX868 C-BUS SERIAL INTERFACE HOST C RING DETECTOR. RELAY DRIVER. The CMX868 is a multi-standard modem for use in telephone based information and telemetry systems. Control of the device is via a simple high-speed serial bus, compatible with most types of C serial peripheral interfaces. The data transmitted and received by the modem is also transferred over the same serial bus. On-chip programmable Tx and Rx USARTs meeting the requirements of V.14 are provided for use with asynchronous data and allow unformatted synchronous data to be received or transmitted as 8-bit words. The CMX868 can transmit and detect standard DTMF and modem calling and answer signals or user-specific programmed single or dual tone signals. A general purpose Call Progress signal detector is also included. 2001 MX-COM, Inc. www.mxcom.com Tel: 800 638 5577 336 744 5050 Fax: 336 744 5054 4800 Bethania Station Road, Winston-Salem, NC 27105-1201 USA Doc. # 208300157.002 All trademarks and service marks are held by their respective companies. Software & Hardware Description 4 of 24 CMX868 & CMX867 Modem Design Guide Flexible line driver and receive hybrid circuits are integrated on chip, requiring only passive external components to build a 2 or 4-wire line interface. The device also features a hook switch relay drive output and a Ring Detector circuit which continues to function when the device is in Powersave mode, providing an interrupt which can be used to wake up the host Controller when line voltage reversal or ringing is detected. The CMX868 operates from a single 2.7 to 5.5V supply over a temperature range of -40C to +85C and is available in 24-pin TSSOP, SOIC and DIP packages. 1.4 CMX867 The CMX867 is identical to the CMX868 described in section 1.3, above, with the exception that the CMX867 does not support V.22bis signaling. This makes the CMX867 upward compatible with the CMX868. 2. Hardware 2.1 Introduction The modem hardware is implemented using an MX-COM CMX868 multi-standard modem chip and a Texas Instruments MSP430F149 low power microcontroller. Using V.22bis signaling the modem can communicate at a maximum data rate of 2400 bits per second, full duplex, over a telephone line. Figure 1, below, shows a block diagram of the circuit. (Note the gyrator circuit is required only for the `CTR21' version.) Polarity Protected DC Voltage Regulator Host C Line State Detection Hook Switch CMX868 V.22bis Modem Line Transformer Ring Isolation RS-232 port +5V common Protection RS-232 level shifter tip ring Gyrator (CTR21 only) DAA / line interface Figure 1, Function Block Diagram Telephone Line State Detection, Host Processor and CMX868 and CTR21 gyrator circuit sections are described below in more detail. 2001 MX-COM, Inc. www.mxcom.com Tel: 800 638 5577 336 744 5050 Fax: 336 744 5054 4800 Bethania Station Road, Winston-Salem, NC 27105-1201 USA Doc. # 208300157.002 All trademarks and service marks are held by their respective companies. Software & Hardware Description 2.2 5 of 24 CMX868 & CMX867 Modem Design Guide Telephone Line State Detection Telephone line state detection indicates whether a phone line is on or off hook. It also resolves when a parallel telephone extension is taken off hook after the modem has started using the line. U4 and its external components provide a difference amplifier with a gain of 1/22 with an output DC offset of 1.65V to condition the tip/ring differential voltage to develop the line-in-use signal. This signal is applied to the MSP430F149 C ADC input that measures it to resolve the telephone line state. A full-wave rectifier precedes the differential amplifier and makes all differential tip/ring input voltages positive. This system resolves differential input voltages over a range of ~5VDC to ~18.5VDC with common mode voltages of up to ~40V. U4 must be a single supply, low input bias current, opamp. Note that 22Mohm resistors R10 and R13 provide galvanic isolation between tip/ring and circuit common by virtue of their very high impedance. Accordingly, layout spacing requirements for `network side' printed circuit board traces and components must be applied to R10 and R13 and their physical terminals. However, their `circuit side' (not `network side') traces need not maintain `network side' spacing because they are sufficiently isolated from tip/ring. 2.2.1 On/Off Hook Detect Operation When the phone is on-hook, the tip/ring voltage magnitude is typically 48VDC. When a parallel phone goes off-hook this voltage normally drops below 18VDC depending on the connected loop resistance. The modem will not use the line if it is already being used as indicated by a tip/ring voltage below 18VDC. Before the modem goes off hook a reading of the line-in-use signal is performed using the MSP 430F149 ADC. If the measured value is greater than 18VDC at tip/ring (greater than 2.47VDC at the input to the ADC) this indicates the phone line is on hook (available) and the modem takes the line off hook. 2.2.2 Intrusion / E911 Detect Operation When the modem is using the phone line some applications prefer it go back on hook when an additional extension is taken off hook. The purpose of this behavior is to release the phone line to allow a person to take control of the line and place a phone call e.g. to place an emergency 911 call (U.S.). Taking a parallel extension off hook when the line is being used by the modem causes the tip/ring voltage to quickly drop ~5% of its prior value. This rapid relative drop is used to resolve when a parallel extension `intrusion' occurs. The modem's off hook tip/ring voltage reference is established by reading the line-in-use voltage with the MSP430F149 ADC, three seconds after the modem goes off hook. Thereafter, line-in-use is measured once each second. If the voltage drops more than ~5% this indicates a parallel extension has gone off hook so the modem drops its connection to defer to the parallel extension user. (Note that intrusion / E911 detect firmware subtracts a constant representing 1.65V from ADC measurements to correct for the differential amplifier's +1.65VDC output offset.) 2.3 Host Processor and CMX868 An MSP430F149 microcontroller is used. This device's features include: integrated Flash (64K), RAM (2K bytes), six 14-bit ADC inputs, and generous digital I/O. Alternative microcontrollers with similar features are available and suitable for use with the CMX868. A distinguishing feature of the MSP430F149 is its low power mode that draws 3A of supply current when operating from a 32kHz crystal. This characteristic complements the CMX868's very low power requirements. If desired, the MSP430F149 can act as both the CMX868 host and user application host, typical of embedded applications. This design includes a serial port interface driver and AT command processing to implement a `desktop modem' application. Communication between the MSP430F149 and the CMX868 (U5) is via a C-BUS serial chip bus (compatible with an SPI bus) to reduce signals and simplify host programming. Header J3 is the JTAG programming port to load the firmware into the MSP430F149 processor for convenient program development. 2.4 Line Interface Circuit (DAA) The line side circuit is a direct access arrangement to properly connect the modem to the telephone line. Components ISO1 and ISO2 provide an isolated ring detect interface and an isolated hook switch. 2001 MX-COM, Inc. www.mxcom.com Tel: 800 638 5577 336 744 5050 Fax: 336 744 5054 4800 Bethania Station Road, Winston-Salem, NC 27105-1201 USA Doc. # 208300157.002 All trademarks and service marks are held by their respective companies. Software & Hardware Description 6 of 24 CMX868 & CMX867 Modem Design Guide Two DAA circuits are provided. One is for `FCC' operation and the other is for `CTR21' operation. While the `CTR21 circuit' is also suited for `FCC' operation, its parts count is higher and so should be used when CTR21 requirements must be satisfied. 2.4.1 `FCC Circuit' This section refers to Figures 2 & 3, `FCC' Schematics Parts 1 & 2. A Midcom 671-8001 `wet' line transformer is used in this design. Similar `wet' line transformers with UL 1950 ratings or similar characteristics may be considered if required for specific applications. Midcom 82111 and Datatronics LM72019 transformers may be of interest for these types of applications. 2.4.2 `CTR21 Circuit' This section refers Figures 3 & 4, `CTR21" Schematics Parts 1 & 2. The gyrator circuit (not required in the `FCC circuit') formed by Q1, R20, R22, R23, R24, C32, and D8 is a DC current sink with a current vs. tip/ring voltage DC response per CTR21 requirements. R20, R22 and R24 form a bias network for Q1 that adjusts the bias according to tip/ring voltage, when that voltage is low enough that D8 does not conduct. When the tip/ring voltage becomes high enough zener diode D8 conducts and clamps to 5.6VDC. This limits the Q1 bias and so limits its collector current so total circuit current is limited to below 60mA per CTR 21. C32 provides a low pass characteristic in the current vs. tip/ring voltage gyrator response so the gyrator's impedance at modem signaling frequencies is sufficiently high and conforms to CTR 21 requirements. This prevents the gyrator from loading and damping modem signaling voltages/currents. This gyrator circuit has been successfully applied in multiple designs that are CTR 21 certified. Please refer to ETSI document TBR 21 January 1998 for additional information on CTR 21 requirements. 2.4.3 Differences between `FCC' and `CTR21' Circuits The circuitry used in these two circuits is nearly identical; the only differences are due to the presence of the gyrator circuit in the CTR21 design. The following components are used in the CTR21 design but have been omitted from the FCC circuit: C27, C32, R20, R22, R23, R24, Q1, and D8. An additional surge suppressor, RV2, is used in the FCC design but is omitted from the CTR21 circuit. With the exceptions of these components, the two circuits are identical. 2001 MX-COM, Inc. www.mxcom.com Tel: 800 638 5577 336 744 5050 Fax: 336 744 5054 4800 Bethania Station Road, Winston-Salem, NC 27105-1201 USA Doc. # 208300157.002 All trademarks and service marks are held by their respective companies. Software & Hardware Description Schematics VCC VCC C5 1UF 1UF 1 2 3 4 5 6 8 X1 32.7688KHz 0.1UF TCLK 9 44 45 46 47 48 49 50 51 52 J3:6 VCC R2 100K C11 0.1UF GND 58 J3:11 59 60 61 12 13 14 15 16 17 18 19 LINE_IN_USE SPIIRQ J3:1 54 J3:3 55 J3:5 56 J3:7 57 7 10 11 53 U2 64 AVcc VCC 0.1UF VCC R3 C1 100K Xout/Tclk P5.0/Ste1 P5.1/Simo1 P5.2/Somi1 P5.3/Uclk1 P5.4/Mclk P5.5/SMclk P5.6/Aclk P5.7/TBoutH XT2out P4.7/TBclk 43 P4.6/TB6 42 P4.5/TB5 41 TMS TCK Vref+ VeRef+ 40 DTR P4.3/TB3 39 RTS P4.2/TB2 38 DCD P4.1/TB1 37 CTS 4 2 3 P3.6?utxd1 34 P3.5/Urxd0 33 P3.4/Utxd0 32 P3.3/Uclk0 31 P3.2/Somi0 30 SPIRDATA P3.1/Simo0 P3.0/Ste0 29 28 SPIWDATA P2.0/Aclk P2.1/TAINclk P2.2/CAout/TA0 P2.3/CA0/Ta1 P2.4/CA1/TA2 P2.5/Rosc P2.6/Adc12clk P2.7/TA0 20 21 22 23 24 25 26 27 SPICSN AVss 62 DVss 63 0.1UF R5 TXD TP1 TP2 RXD 17 1K 14 15 GND SPICLK 16 DTR R6 1K R7 21 RTS D4 20 18 D5 C2 C1+ VCC 26 0.1UF C1C2+ GND 2 GND VCC GND C2- C3 V+ 27 V- 4 T5IN T1OUT 5 J1:2 SHDN T2OUT 6 J1:9 EN T3OUT 7 J1:6 MBAUD T4OUT 10 J1:8 R1OUTB T5OUT 12 J1:1 T1IN 0.1UF T2IN T3IN T4IN C9 0.1UF GND R1OUT R1IN 8 J1:7 R2OUT R2IN 9 J1:4 R3OUT R3IN 11 MAX3238ECAI 1K J1:3 GND J1:5 TXD GND 1 0.1UF C14 C15 3 10UF 4 19 CTS 13 1 DF10S 22 D3 VCC C13 + 23 RI DSR DSR TP3 U3 BR1 3 24 VCC - 1 D2 2 2 25 C10 DCD MSP430F149 FUSE(R459.250UR) J2:B RXD 1K 3 1 GND R4 F1 J2:A 28 0.1UF VCC 35 U1 C8 S1:B 36 Vref-/VeRefXT2in 1 RI P4.4/TB4 TDO/TDI 10UF S1:A 100K P4.0/TB0 P6.0/A0 P6.1/A1 P6.2/A2 P1.0/Taclk P1.1/TA0 P1.2/TA1 P1.3/TA2 P1.4/SMclk P1.5/TA0 P1.6/TA1 P1.7/TA2 TDI R25 P3.7/Urxd1 RST/NMI GND GND C4 DVcc P6.3/A3 P6.4/A4 P6.5/A5 P6.6/A6 P6.7/A7 Xin 2 VIN 10UF VOUT 5 BYPASS 4 SHDN GND TP4 VCC D1 C7 GND GND LP2981AIM TP5 1K C6 GND CMX868 & CMX867 Modem Design Guide R1 3. 7 of 24 GND GND 1 Figure 2, 'FCC' Schematic Part 1 2001 MX-COM, Inc. www.mxcom.com Tel: 800 638 5577 336 744 5050 Fax: 336 744 5054 4800 Bethania Station Road, Winston-Salem, NC 27105-1201 USA Doc. # 208300157.002 All trademarks and service marks are held by their respective companies. Software & Hardware Description 8 of 24 CMX868 & CMX867 Modem Design Guide VCC C16 5 BR2 + 1 D9 4 17 TP6 RXA 10 TXA 15 VSS TXA 14 VSS RXA 11 VSS VBIAS 13 VSS R14 470K 20K R17 VSS 5 3 CMX868 C29 GND 21 9 6 2 P6KE12A C31 GND 4 PS7341-1A R19 12 RXAFB REPLYDATA ISO2 1 1K (NOT FITTED) 8 IRQ R11 GND 100K 4 RDRV 3 C23 330nF 0.1UF 100K SPIIRQ RD 5 GND 2.0mm TO 2.5mm MINIMUM SPACING AWAY FROM OTHER TRACES NO GROUND PLANE OR VCC PLANE UNDER THIS SECTION. 100K 23 6 R18 R16 VCC 24 RT 100PF 22 SERIALCLOCK VDD 0.1UF VCC R21 SPICLK COMNDATA 16 C26 20 CS 7 VDD 470 19 VDD 15nF 18 XTAL/CLOCK C28 22PF XTAL 0.1UF 1 C24 10K 1N4004 11.0592MHz U5 R15 K 1N5251B PS2801-1 SPIWDATA SPIRDATA 2 VCC 2 SPICSN A 1 D7 0.1UF X2 C25 C21 ISO1 GND 3 GND J4 1000PF VCC C18 22PF 4 1M 10UF C22 2 4 R12 P3100SA_RP 2 22M GND - RV1 2 DF10S C19 1 2 3 R13 0.1UF F2 FUSE(429.375WR) 1 VCC 1 3 K C20 TEL_JACK/4 22M 1N5226B 3 A - R10 R9 1 C12 TLV2211 + 2M 2 0.1UF U4 4 LINE_IN_USE GND 2M C17 R8 V+ V- 1000PF VCC 0.1UF D6 GND 1 2 T1 1 4 2 RV2 3 TRNSFMR_671-8001 2 Figure 3, 'FCC' Schematic, Part 2 2001 MX-COM, Inc. www.mxcom.com Tel: 800 638 5577 336 744 5050 Fax: 336 744 5054 4800 Bethania Station Road, Winston-Salem, NC 27105-1201 USA Doc. # 208300157.002 All trademarks and service marks are held by their respective companies. Software & Hardware Description 9 of 24 CMX868 & CMX867 Modem Design Guide --**MX-COM, INC.**-- VCC VCC C5 1UF 1UF X1 32.7688KHz 0.1UF TCLK 9 44 45 46 47 48 49 50 51 52 J3:6 VCC R2 C11 100K 0.1UF GND 58 J3:11 59 60 61 12 13 14 15 16 17 18 19 LINE_IN_USE SPIIRQ J3:1 54 J3:3 55 J3:5 56 J3:7 57 7 10 11 53 U2 64 AVcc VCC 0.1UF VCC R3 C1 100K Xout/Tclk P5.0/Ste1 P5.1/Simo1 P5.2/Somi1 P5.3/Uclk1 P5.4/Mclk P5.5/SMclk P5.6/Aclk P5.7/TBoutH XT2out P6.0/A0 P6.1/A1 P6.2/A2 P1.0/Taclk P1.1/TA0 P1.2/TA1 P1.3/TA2 P1.4/SMclk P1.5/TA0 P1.6/TA1 P1.7/TA2 P4.7/TBclk 43 P4.6/TB6 42 TMS TCK Vref+ VeRef+ 41 P4.4/TB4 40 DTR P4.3/TB3 39 RTS 1 4 2 3 38 DCD P4.1/TB1 37 CTS 1 GND RXD 35 P3.6?utxd1 34 P3.5/Urxd0 33 P3.4/Utxd0 32 P3.3/Uclk0 31 P3.2/Somi0 30 P3.1/Simo0 P3.0/Ste0 29 28 SPIWDATA P2.0/Aclk P2.1/TAINclk P2.2/CAout/TA0 P2.3/CA0/Ta1 P2.4/CA1/TA2 P2.5/Rosc P2.6/Adc12clk P2.7/TA0 20 21 22 23 24 25 26 27 SPICSN AVss 62 DVss 63 0.1UF TP1 D3 TP2 RXD 17 1K 14 13 GND 16 DTR SPIRDATA 21 RTS R6 D4 1K R7 20 18 D5 C2 C1+ VCC 26 0.1UF C1C2+ GND 2 GND VCC GND C2- C3 V+ 27 V- 4 T5IN T1OUT 5 J1:2 SHDN T2OUT 6 J1:9 EN T3OUT 7 J1:6 MBAUD T4OUT 10 J1:8 R1OUTB T5OUT 12 J1:1 T1IN 0.1UF T2IN T3IN T4IN C9 0.1UF GND R1OUT R1IN 8 J1:7 R2OUT R2IN 9 J1:4 R3OUT R3IN 11 MAX3238ECAI 1K J1:3 GND J1:5 TXD GND 3 1 0.1UF C14 C15 3 10UF 4 15 SPICLK 1 DF10S 19 CTS R5 TXD VCC C13 + 22 DSR TP3 U3 BR1 23 RI DSR VCC - 3 24 2 2 1 D2 1K 36 25 C10 DCD MSP430F149 FUSE(R459.250UR) J2:B 0.1UF R4 F1 J2:A 28 VCC P4.0/TB0 U1 C8 S1:B RI P4.2/TB2 Vref-/VeRefXT2in 10UF S1:A 100K P4.5/TB5 TDO/TDI TDI R25 P3.7/Urxd1 RST/NMI GND GND C4 DVcc P6.3/A3 P6.4/A4 P6.5/A5 P6.6/A6 P6.7/A7 Xin 2 VIN 10UF VOUT 5 BYPASS 4 SHDN GND TP4 VCC D1 1 2 3 4 5 6 8 GND GND LP2981AIM TP5 1K C7 GND R1 C6 GND GND Title: CMX868 REFERENCE DESIGN BOARD Size Date: 10/24/01 DWG by: BNP ???? CHK by: JCK/RH MX CR# Filename: CMX868_CTR21.sch MX-COM, INC. Sheet 2 1 of Figure 4, `CTR21' Schematic, Part 1 2001 MX-COM, Inc. www.mxcom.com Tel: 800 638 5577 336 744 5050 Fax: 336 744 5054 4800 Bethania Station Road, Winston-Salem, NC 27105-1201 USA Doc. # 208300157.002 All trademarks and service marks are held by their respective companies. Software & Hardware Description 10 of 24 CMX868 & CMX867 Modem Design Guide VCC C16 R8 2M 5 22M GND - BR2 + 1 1 D9 4 470K 10K 4 2 R20 4.7K R22 1 2 4 SET0902 30 Ohm T1 5 R23 6 10K C31 3 CZT2000 R24 R14 GND Q1 1 1UF 13 CMX868 C32 VBIAS K 11 VSS 1N5232B 14 RXA D8 TXA VSS 4 PS7341-1A A VSS VSS 3 C27 TXA 15 20K R17 10 C29 GND 21 RXA 5 10UF/50V TP6 VSS 6 R19 17 9 2.0mm TO 2.5mm MINIMUM SPACING AWAY FROM OTHER TRACES NO GROUND PLANE OR VCC PLANE UNDER THIS SECTION. ISO2 1 2 (NOT FITTED) 12 RXAFB REPLYDATA GND 1K 100K 8 IRQ R11 GND 0.1UF 4 RDRV 3 C23 330nF 100K 100K SPIIRQ RD 5 R18 23 6 100PF R16 VCC RT 0.1UF VCC R21 22 SERIALCLOCK 24 C26 SPICLK COMNDATA 16 VDD 470 20 VDD 15nF 19 XTAL/CLOCK CS 7 C28 18 VDD 0.1UF 22PF XTAL C24 10K 1N4004 11.0592MHz 1 R15 K 1N5251B PS2801-1 U5 SPIWDATA SPIRDATA 2 VCC 2 SPICSN A 1 D7 0.1UF X2 C25 C21 ISO1 GND 3 GND J4 1000PF VCC C18 22PF 4 1M 10UF C22 2 4 R12 P3100SA_RP 2 2 DF10S C19 1 2 3 R13 0.1UF F2 FUSE(429.375WR) RV1 VCC 1 3 K C20 TEL_JACK/4 22M 1N5226B 3 A - R10 R9 1 C12 TLV2211 + 2M 2 0.1UF U4 4 LINE_IN_USE GND 1000PF V+ V- C17 VCC 0.1UF D6 GND 3 2 Figure 5, `CTR21' Schematic, Part 2 2001 MX-COM, Inc. www.mxcom.com Tel: 800 638 5577 336 744 5050 Fax: 336 744 5054 4800 Bethania Station Road, Winston-Salem, NC 27105-1201 USA Doc. # 208300157.002 All trademarks and service marks are held by their respective companies. Software & Hardware Description 4. 11 of 24 CMX868 & CMX867 Modem Design Guide BOMs - Bills Of Materials Bills of materials are provided for both the `FCC' and `CTR21' schematics. Section 2.4.1, pg. 6, provides a detailed description of their differences. Table 1, `FCC' Bill of Materials Schematic Part Number BR1, BR2 C2, C3, C4, C7, C8, C9, C10, C11, C12, C15, C16, C18, C20, C29 C5, C6 C17, C21 C1, C13, C14, C19 C22, C25 C23 C24 C26 C28 D1, D2, D3, D4, D5 D6 D7 D9 F1 F2 ISO1 ISO2 J1 J2 J3 J4 R8, R9 R10, R13 R1, R4, R5, R6, R7, R11 R12 R14 R15 R2, R3, R16, R18, R19, R25 R17 R21 RV1 RV2 SW1 2001 MX-COM, Inc. Location Component Name Description Various Diode Bridge Single phase, 1A, 1000V Manufacturer General Semiconductor, Fairchild Semiconductor, etc. Various Various Near RJ-11 jack Decoupling CMX868 xtal circuit CMX868 RT pin Ring detector input CMX868 RXA piin CMX868 TXA pin Various Line-in-use circuit Ring detector input Ring detector input Power supply RJ-11 connection Ring detector Hook switch RS-232 circuit Power supply Microcontroller circuit Telephone line connection Line-in-use circuit Line-in-use circuit Various Output of line-in-use amplifier CMX868 RT pin Various Various CMX868 RD pin pulldown CMX868 TXA feedback RJ-11 connection Capacitor Capacitor Capacitor Capacitor Capacitor Capacitor Capacitor Capacitor Capacitor LED Zener diode Diode Zener diode Fuse Fuse Optocoupler Solid state relay Connector Connector 0.1uF, 16V, surface-mount 1.0uF, 16V Ceramic, 1000pF, 3000V, X7R, 10%, SMD1206 pkg 10uF, 16V 22pF, 50V 0.33uF, 16V 0.1uF, 250V 100pF, 50V 0.015uF, 16V Red 3.3V, 0.5W, 5% 400V, 1A, rectifier 22V, 500mW, 5% 125V, 0.25A, very fast acting, surface mount 125V, 0.375A, fast blow, surface mount 2.5kV isolation voltage, single channel 1 Form A SSR, 3750V isolation Female, DB-9 Two contact (power and ground) Venkel Venkel Panasonic-ECG Panasonic-ECG Venkel Venkel Venkel Venkel Venkel Generic Microsemi Micro Commercial Co. Microsemi Littelfuse Littelfuse NEC NEC, Solid State Optronics Generic Generic C0603X7R160-104KNE C0603X74160-105KNE ECK-D3F102KBP ECE-A1CKA100 C0603COG500-220JNE C0603Y5V160-334ZNE C1206X7R251-104KNE C0603COG500-101JNE C0603X7R160-153KNE Generic 1N5226B 1N4004 1N5251B R459.250UR 429.375WR PS2801-1 PS7341-1A Generic Generic 14 2 2 4 2 1 1 1 1 5 1 1 1 1 1 1 1 1 1 Connector Telephone Connector Resistor Resistor Resistor Programming connector Side entry, 6-4 contacts, unshielded, no panel stops or flange 2M, 1/16W, 5% 22M, 1/16W, 5% 1k, 1/16W, 5% 3M 2514-6002 1 AMP Venkel Generic Venkel 555979-1 CR0603-16W-205JT Through-hole CR0603-16W-102JT 1 2 2 6 Resistor Resistor Resistor Resistor 1M, 1/16W, 5% 470k, 1/16W, 5% 10k, 1/16W, 5% 100k, 1/16W, 5% Venkel Venkel Venkel Venkel CR0603-16W-105JT CR0603-16W-474JT CR0603-16W-103JT CR0603-16W-104JT 1 1 1 6 Resistor 20k, 1/16W, 5% Venkel CR0603-16W-203JT 1 Resistor Protection Diode Venkel Teccor Electronics Inc. CR0603-16W-471JT P3100SA_RP 1 1 Transformer circuit Microcontroller circuit Protection Diode 470, 1/16W, 5% Sidactor, 275V, surge suppressor Transient voltage suppressor, 68V, 600W, unidirectional Crydom Co. P6KE68A 1 Switch DPDT Generic generic 1 www.mxcom.com Tel: 800 638 5577 336 744 5050 Fax: 336 744 5054 4800 Bethania Station Road, Winston-Salem, NC 27105-1201 USA Mfg Part Number Qty DF10S 2 Doc. # 208300157.002 All trademarks and service marks are held by their respective companies. Software & Hardware Description Schematic Part Number 12 of 24 Location CMX868 & CMX867 Modem Design Guide Component Name Coupling Transformer RS-232 transceiver Description Wet, through hole, impedance ratio 600:470 (primary:secondary) 3.0-5.0V, 5 Tx channels, 3 Rx channels, 10nA, 250kbps Midcom 671-8001 1 Maxim, Texas Instruments MAX3238ECAI 1 Manufacturer Mfg Part Number Qty T1 Line interface U1 Microcontroller Regulator Opamp Modem Low power, 2kB RAM, 60kB + 256B FLASH 3.3V CMOS LDO Single channel, rail-to-rail, low voltage, low power CMX868 2400bps modem Texas Instruments National Semiconductor Texas Instruments MX-COM MSP430F149IPM LP2981AIM5-3.3 TLV2211 CMX868 1 1 1 1 X1 RS-232 circuit Microcontroller circuit Power supply circuit Line in use circuit Modem circuit Microcontroller circuit Crystal Epson C-001R 32.768K-A 1 X2 Modem circuit Crystal 32.7688kHz Low profile, Metal Can, Through Hole, 11.0592Mhz, 50ppm tolerance, 50ppm stability, 18pf Load cap Citizen HC49US11.0592MBBJTR 1 U2 U3 U4 U5 2001 MX-COM, Inc. www.mxcom.com Tel: 800 638 5577 336 744 5050 Fax: 336 744 5054 4800 Bethania Station Road, Winston-Salem, NC 27105-1201 USA Doc. # 208300157.002 All trademarks and service marks are held by their respective companies. Software & Hardware Description 13 of 24 CMX868 & CMX867 Modem Design Guide Table 2, `CTR21' Bill of Materials Schematic Part Number BR1, BR2 C2, C3, C4, C7, C8, C9, C10, C11, C12, C15, C16, C18, C20, C29 C5, C6, C32 C17, C21 C1, C13, C14, C19 C22, C25 C23 C24 C26 C27 C28 D1, D2, D3, D4, D5 D6 D7 D8 D9 F1 F2 ISO1 ISO2 J1 J2 J3 J4 Q1 R8, R9 R10, R13 R1, R4, R5, R6, R7, R11 R12 R14 R15, R22, R24 R2, R3, R16, R18, R19, R25 R17 R20 R21 R23 RV1 Location Various Diode Bridge Single phase, 1A, 1000V Manufacturer General Semiconductor, Fairchild Semiconductor, etc. Various Various Near RJ-11 jack Decoupling CMX868 xtal circuit CMX868 RT pin Ring detector input CMX868 RXA pin Transformer input CMX868 TXA pin Various Line-in-use circuit Ring detector input Line-in-use circuit Ring detector input Power supply RJ-11 connection Ring detector Hook switch RS-232 circuit Power supply Microcontroller circuit Telephone line connection Capacitor Capacitor Capacitor Capacitor Capacitor Capacitor Capacitor Capacitor Capacitor Capacitor LED Zener diode Diode Zener diode Zener diode Fuse Fuse Optocoupler Solid state relay RS-232 Connector Power Connector Programming Connector Telephone Connector Darlington transistor Resistor Resistor Resistor Resistor Resistor Resistor Resistor Resistor Resistor Resistor Resistor Protection Diode 0.1uF, 16V 1.0uF, 16V Ceramic, 1000pF, 3000V, X7R, 10%, SMD1206 pkg 10uF, 16V 22pF, 50V 0.33uF, 16V 0.1uF, 250V 100pF, 50V 10uF, 50V 0.015uF, 16V Red 3.3V, 0.5W, 5% 400V, 1A, rectifier 5.6V, 0.5W, 5% 22V, 500mW, 5% 125V, 0.25A, very fast acting, surface mount 125V, 0.375A, fast blow, surface mount 2.5kV isolation voltage, single channel 1 Form A SSR, 3750V isolation Female, DB-9 Two contact (power and ground) Venkel Venkel Panasonic-ECG Panasonic-ECG Venkel Venkel Venkel Venkel Panasonic-EEU Venkel Generic Microsemi Micro Commercial Co. Microsemi Microsemi Littelfuse Littelfuse NEC NEC, Solid State Optronics Generic Generic C0603X7R160-104KNE C0603X7R160-105KNE ECK-D3F102KBP ECE-A1CKA100 C0603COG500-220JNE C0603Y5V160-334ZNE C1206X7R251-104KNE C0603COG500-101JNE EEU-FC1H100L C0603X7R160-153KNE Generic 1N5226B 1N4004 1N5232B-T 1N5251B R459.250UR 429.375WR PS2801-1 PS7341-1A Generic Generic 14 3 2 4 2 1 1 1 1 1 5 1 1 1 1 1 1 1 1 1 1 Programming connector Side entry, 6-4 contacts, unshielded, no panel stops or flange 3M 2514-6002 1 AMP 555979-1 1 NPN Darlington, 200V, 600mA, 2W, SOT-223 pkg 2M, 1/16W, 5% 22M, 1/16W, 5% 1k, 1/16W, 5% 1M, 1/16W, 5% 470k, 1/16W, 5% 10k, 1/16W, 5% 100k, 1/16W, 5% 20k, 1/16W, 5% 4.7k, 1/16W, 5% 470, 1/16W, 5% 30, 1W, 5% Sidactor, 275V, surge suppresor Central Semiconductor Venkel Generic Venkel Venkel Venkel Venkel Venkel Venkel Venkel Venkel Venkel Teccor Electronics CZT2000 CR0603-16W-205JT Through-hole CR0603-16W-102JT CR0603-16W-105JT CR0603-16W-474JT CR0603-16W-103JT CR0603-16W-104JT CR0603-16W-203JT CR0603-16W-472JT CR0603-16W-471JT CR2512-1W-300JT P3100SA_RP 1 2 2 6 1 1 3 6 1 1 1 1 1 Switch Coupling Transformer DPDT Dry, SMT, V.34bis rated, impedance ratio 600:301 (primary:secondary) Generic Taipei Multipower Electronics Co. generic 1 SET0902 1 SW1 Gyrator circuit Line-in-use circuit Line-in-use circuit Hook switch circuit Line-in-use circuit CMX868 RT pin Ring detector input Various CMX868 RD pin Gyrator circuit CMX868 TXA pin Gyrator circuit RJ-11 connection Microcontroller circuit T1 Line Interface 2001 MX-COM, Inc. Component Name Description www.mxcom.com Tel: 800 638 5577 336 744 5050 Fax: 336 744 5054 4800 Bethania Station Road, Winston-Salem, NC 27105-1201 USA Mfg Part Number Qty DF10S 2 Doc. # 208300157.002 All trademarks and service marks are held by their respective companies. Software & Hardware Description Schematic Part Number U1 14 of 24 Location X1 RS-232 circuit Microcontroller circuit Power supply circuit Line in use circuit Modem circuit Microcontroller circuit X2 Modem circuit U2 U3 U4 U5 2001 MX-COM, Inc. CMX868 & CMX867 Modem Design Guide Component Name RS-232 transceiver Description 3.0-5.0V, 5 Tx channels, 3 Rx channels, 10nA, 250kbps Maxim, Texas Instruments MAX3238ECAI 1 Microcontroller Low power, 2kB RAM, 60kB + 256B FLASH Texas Instruments MSP430F149IPM 1 Regulator Opamp Modem 3.3V CMOS LDO Single channel, rail-to-rail, low voltage, low power CMX868 2400bps modem National Semiconductor Texas Instruments MX-COM LP2981AIM5-3.3 TLV2211 CMX868 1 1 1 Crystal 32.7688kHz Low profile, Metal Can, Through Hole, 11.0592Mhz, 50ppm tolerance, 50ppm stability, 18pf Load cap Epson C-001R 32.768K-A 1 Citizen HC49US11.0592MBBJTR 1 Crystal Manufacturer www.mxcom.com Tel: 800 638 5577 336 744 5050 Fax: 336 744 5054 4800 Bethania Station Road, Winston-Salem, NC 27105-1201 USA Mfg Part Number Qty Doc. # 208300157.002 All trademarks and service marks are held by their respective companies. Software & Hardware Description 5. 15 of 24 CMX868 & CMX867 Modem Design Guide Firmware The firmware is authored in the C programming language using IAR 430 Embedded Workbench Kit V1.24A under Windows 95/98/NT for the Texas Instruments MSP 430 microcontroller family (PC Host), available from IAR Systems Software Inc. (www.iar.com). The use of the C language makes the firmware readable and permits it to be readily ported to other microcontrollers, if desired. The firmware provided allocates 1kbytes of RAM to stack space (approximately 25% of which is used), 404 bytes of RAM variable space and 14.1 kbytes of ROM (flash) code space. Firmware source code will be made available at www.mxcom.com for downloading. 5.1 Compiler Switches The firmware supports a variety of hardware configurations and firmware features. Compiler switches are used to conditionally compile needed code. Setting the compiler switches in the header file LwPwr430.h according to Table 3, below, enables compilation of the code required for this design. Table 3, Compiler Switches Features Echo all chars after a back to same modem. 80 char buffer. Sends/Receives chars to/from phone line to/from an RS232 port. Monitors for Line Surrender A/D active, After off-hook 3 seconds measure voltage- RefVoltage. Then every 1 second if( ( (RefVoltage * 0.95) < measured voltage )) then drop the call Compiler Switches Firmware Switch Setting MXCommEcho Off Rs232Comm Yes A_DActiveSurrende r Yes A_DActiveShare Yes KeyPadAttached Off SleepOk Off BaudSwitch Yes Monitors for Line Share A/D active, before going off-hook measure A/D voltage. If (StartVoltage > 1.5V) then go off-hook [This code is applicable only if Key Pad is present] `#' starts phone number, next `#' indicates dial phone number. `*' indicates start phone number over MSP430 & CMX868 Low Power mode when not in use Switch for selectable Rs232 rate 1200/2400 P4.7 2001 MX-COM, Inc. www.mxcom.com Tel: 800 638 5577 336 744 5050 Fax: 336 744 5054 4800 Bethania Station Road, Winston-Salem, NC 27105-1201 USA Doc. # 208300157.001 All trademarks and service marks are held by their respective companies. Software & Hardware Description 5.2 16 of 24 CMX868 & CMX867 Modem Design Guide Firmware Modes The modem firmware operates in the modes depicted in Figure 4, below. * Power On MSP430 powers up and initializes the CMX868 registers and then enters the Wait for Event mode. If Sw1-1 is ON the modem is set to 1200 baud rate. If Sw-1-1 is OFF the modem is set to 2400 baud rate. * Wait for Event Mode MSP430 waits for either a Ring Detect from the CMX868 or AT Command input from the RS-232 port. Whichever event occurs first causes the associated function to be executed. * Modem Baud Rate Mode In response to either a ring detect from the CMX868 or dialing an outbound call (to connect with another modem) this mode attempts to negotiate a connection at 2400bps or 1200bps with the remote modem. (If the modem is set to 1200 baud the negotiated baud rate will be similarly 1200.) If the baud rate is successfully negotiated, the MSP430 goes to Transfer Mode. If the baud rate is not successfully negotiated, the MSP430 goes back to Wait for Event Mode. * Transfer Mode Data is sent to and from the phone line and the terminal connected at the RS-232 port. A transition to the Wait for Event Mode occurs when either the phone call is disconnected or a parallel extension is taken off hook. A transition to AT Command mode occurs when the +++ escape sequence is entered at the RS-232 port and, in this case, a return to Transfer mode will occur if an ATO command is entered at the RS-232 port. * AT Command Mode Accept basic AT commands and act on them. After done with AT Command return to Wait for Event Mode. If AT Command is a dial command first check phone line to determine if it is already in use. If the phone line is not in use dial call and go to Modem Baud Rate Mode. Power On and initialize Wait for Event Mode AT command finished AND was not connected Connection not successful AT command entered Ring Detect ATDT command AND line not in use Modem Baud Rate Mode Phone line disconnected OR other extension taken off-hook Connection successful AT Command Mode +, +, + escape sequence entered ATO command entered AND was connected Transfer Mode Figure 4, Firmware Modes At any given time the modem is either (1) connected or (2) not connected to a remote modem. DATAXFER is a variable that indicates this condition (1 = connected to a remote modem). Similarly, at any given time the modem's RS232 port is transferring either (1) AT commands and responses or (2) Tx and Rx data over the phone line. ATCMDMODE is a variable that indicates this condition (1 = AT commands). Table 4, below, describes the firmware modes and related variables. 2001 MX-COM, Inc. www.mxcom.com Tel: 800 638 5577 336 744 5050 Fax: 336 744 5054 4800 Bethania Station Road, Winston-Salem, NC 27105-1201 USA Doc. # 208300157.001 All trademarks and service marks are held by their respective companies. Software & Hardware Description 17 of 24 CMX868 & CMX867 Modem Design Guide Table 4, Firmware Modes and Related Variables Variable Value ATCMDMODE DATAXFER 0 0 5.3 Current Mode Modem Baud Rate 0 1 Transfer 1 0 Wait for Event 1 0 AT Command 1 1 AT Command Prior Mode any any NOT Transfer Mode Wait for Event Mode Transfer Mode Description A call has been initiated or received and the modem is negotiating a connection with a remote modem. Modem is connected to a remote modem and data is being transferred. Mode that awaits either an incoming call or local entry of an AT command. Mode to process an AT command that was entered when in Wait for Event mode. Mode to process an AT command that was entered when in Transfer mode. Interrupts Three C interrupts are utilized by the firmware. Two, one each for Tx and Rx serial transfers to and from the CMX868, are produced by the C's internal serial port when action is required. For example a serial Rx data interrupt occurs when data has been received by the C serial port and requires reading via firmware. Similarly, a serial Tx data interrupt occurs when the last bit of data is being transmitted out of the C's Tx serial buffer. The uiTransmitBusy flag, used in the firmware, indicates when the C transmit serial port is currently processing data (1 = busy, 0 = idle). The third interrupt is produced by the C's timer and is configured to trigger each 10mS. The associated timer interrupt service routine decrements any non-zero timer variables until they reach a value of zero. 5.4 Timers Several firmware operations must be performed according to time schedules. General purpose timer variables GPT1 and GPT6 are set to non-zero values in firmware. Thereafter they are decremented each 10mS by the timer interrupt routine until they reach a value of zero. This allows code to be conditionally executed when a timer variable reaches a value of zero. C serial port service routines may not use the general purpose timers. 5.5 Source Code Functions LPMain.c, Rev 1.1 Function main(). Main function for firmware algorithm. ADCFunction.c, Rev 1.1 Functions for A/D 1. InitADCon() This function initializes the A/D. 2. TurnOffADC( ) This function turns off the A/D. 3. CheckADC( ) When A/D has been initialized; this function determines the current A/D value. 4. DisplayADC( ) For debugging, display ADC values. Clrlpm3.s43 Function clrlpm3 This function exits low power mode 3. Clrlpm4.s43 Function clrlpm4 This function exits low power mode 4. 2001 MX-COM, Inc. www.mxcom.com Tel: 800 638 5577 336 744 5050 Fax: 336 744 5054 4800 Bethania Station Road, Winston-Salem, NC 27105-1201 USA Doc. # 208300157.001 All trademarks and service marks are held by their respective companies. Software & Hardware Description 18 of 24 CMX868 & CMX867 Modem Design Guide CMX868.c, Rev 1.0 Functions to set up and communicate with the cmx868 1. ShortDelay() Short delay function. 2. InitCmx868andSPI0 () Initialize MSP430 serial port and CMX 868. 3. SleepCMX() MSP430 sets the CMX868 to generate an interrupt on telephone line ring during CMX sleep mode, and MSP430 sets CMX868 to sleep mode. 4. WakeCMX() MSP430 wake up for CMX868. 5. Read868Status() Reads CMX status register. The result is put in global variables CMXSTAT_HREG, CMXSTAT_LREG. 6. WriteTx868() Writes byte sent to function to CMX868 transmit register, no return data expected. 7. wr8_cbus () Writes given byte to given CMX868 register. 8. wr16_cbus() Writes given integer to given CMX868 register. 9. rd8_cbus () Reads byte from CMX868 register and returns value. 10. rd16_cbus () Reads integer from CMX868 register and returns value. 11. reset_cbus() Reset and clear CMX868. 12. pwrup() Power up and reset for CMX868. CMX868Regs.c, Rev 1.0 Function defines global variables used by CMX868. GenStringsToPC.c, Rev 1.4 Functions for strings to PC, initialize S Register Values and phone off hook function 1. genmsgtopc() Send AT command replies to PC. 2. resmsgtopc() Send modem progress messages to PC. 3. init_sregs() Initialize S Registers to either default 0 or 1 state (see S-Registers section for Values). 4. hook() function for phone line on/off hook. 5. EchoCmdIn () Function to echo back to PC AT command sent. Hndshake.c, Rev 1.1 Functions to negotiate modem call/baud rates 1. hndshake_init() Initialize CMX868 for handshake negotiations. 2. hndshake_go() Negotiate handshakes. Keypad.c, Rev 1.0 Functions for Keypad 1. InitKeyPadMonitor() Initialize interrupt for Key `#' pressed. 2. KeyPadScan () Scan for Keys Pressed. 3. KeyPadInput() Determine Key Pressed. kjh_atcmd.c, Rev 1.1 Functions for AT commands 1. atcmd_interpret() Parse AT command string and process message. ModemXfer.c, Rev 1.3 Functions for modem interface 1. ModemSending() Transfer data on phone line. Either echo mode or to/from Rs232 for modem interface. 2. hangup() Monitor if the phone line is active. Hang up if phone line is not active. 3. CheckPhoneLineBefore () use A/D values to determine if phone line is already in use. 4. ringdetection() Monitor CMX868 for a telephone line ringing. 5. dial() Dial phone number. 6. BusyTone () Monitor CMX868 to determine if phone line is busy after dial. 7. DialTone () Monitor CMX868 to determine if dial tone is present after phone line goes off hook. 2001 MX-COM, Inc. www.mxcom.com Tel: 800 638 5577 336 744 5050 Fax: 336 744 5054 4800 Bethania Station Road, Winston-Salem, NC 27105-1201 USA Doc. # 208300157.001 All trademarks and service marks are held by their respective companies. Software & Hardware Description 19 of 24 CMX868 & CMX867 Modem Design Guide MspInts.c, Rev `8/20/01' Functions for MSP430 interrupt initialization and handling 1. InitForIntrpts() Initialize interrupt global variables. 2. intTxhand() transmit interrupt for data to PC. 3. intRxhand() receive interrupt for data from PC. 4. TIMERA0_Handler() system timer interrupt for monitoring timed events in MSP functions. 5. PORT1_Handler () interrupt for keypad monitoring for initial `#'. SelectBaudRate.c, Rev 1.1 1. SelectBaudRate() determines Baud Rate for PC/Rs232 port. Timers.c, Rev 1.1 Functions for system timer, for timed events in MSP430 1. InitTimers () Initialize MSP430 timer. 2. StopTimers () Stop MSP430 timer. 3. StartTimers () Start MSP430 timer. 4. DelayMs() function to generate a hard delay (not background delay). Value sent in 10's of milliseconds. 5. Delay1s() function to generate a hard delay(not background delay). Value sent in seconds. 5.6 Basic AT Commands Comman d A A/ Bn Dn En Description Answer Command The modem will go off-hook, transmit the answer tone, and wait for a carrier from the remote modem. Syntax: ATA Re-Execute Previous Command Line Re-executes the last issued command line. This command does not require the AT prefix or a carriage return. Syntax: A/ Select Communications Standard Selects the communications standard specified by the parameter n. Syntax: ATBn Modifier Usage n=0 Selects ITU-T V.22bis at 2400bps QAM (default). n=1 Selects ITU-T V.22 at 1200bps DPSK. n=2 Selects ITU-T V.23 with Tx 75bps and Rx 1200bps FSK. [not tested] n=9 Selects Bell 103 at 300bps FSK. [not tested] Dial Command This command directs the modem to go off-hook, dial according to the string entered and attempt to establish a connection. The n represents an ASCII string composed of dial digits and dial modifiers and must not exceed the 23 character buffer limit. The DTMF tone dialing digits include 0 through 9, A, B, C, D, and the symbols # and *. For example: ATD9,01621875500 Modifier Usage n=L Re-dial last number. n=, Delay dial sequence (pause setting contained in S-Register S8). Echo Command Characters Syntax: ATEn Modifier Usage n=0 Disables the echoing of commands to the screen. n=1 Enables echoing of commands to the screen (default). 2001 MX-COM, Inc. www.mxcom.com Tel: 800 638 5577 336 744 5050 Fax: 336 744 5054 4800 Bethania Station Road, Winston-Salem, NC 27105-1201 USA Doc. # 208300157.001 All trademarks and service marks are held by their respective companies. Software & Hardware Description Comman d Hn In O Qn Sn? Sn=x Vn Xn 20 of 24 CMX868 & CMX867 Modem Design Guide Description Switch Hook Control Syntax: ATHn Modifier Usage n=0 Instructs the modem to go on-hook (disconnect). n=1 Instructs the modem to go off-hook. Identification Requests the modem to return its product identification information. Syntax: ATIn Modifier Usage n=0 Displays the firmware name and version number. n=1 Displays Product Name. n=2 Displays European sales information. n=3 Displays South East Asia sales information. n=4 Displays MX-COM sales information. Return to On-Line Mode Syntax: ATO Enable/Disable Modem Responses Syntax: ATQn Modifier Usage n=0 Enables result codes to be issued to the screen (default). n=1 Disables result codes to be issued to the screen. S-Register Read Command for displaying the contents of an S-Register (See S-Register Table). Syntax: AT@Sn? where n is the S-Register to be interrogated (decimal). Value returned will be in decimal format (i.e 043). S-Register Write Command for writing to an S-Register (See S-Register Table). Syntax: AT@Sn=x where n is the S-Register (decimal) and x is the value to be written (decimal, 0-255). Result Code Format Syntax: ATVn Modifier Usage n=0 Instructs the modem to display result codes as numbers. n=1 Instructs the modem to display result codes as words (default). Calling Characteristics Determines which set of responses and calling characteristics are used. Syntax: ATXn Modifier Usage n=0 The modem will ignore dial tones and busy tones. Dial tone wait time is zero, and blind dialing is enabled. The modem returns a CONNECT result code when a connection is established. n=1 The modem will ignore dial tones and busy tones. Dial tone wait time is zero, and blind dialing is enabled. The modem returns a CONNECT xxxx result code when a connection is established, where xxxx is the Tx/Rx line speed (default). n=2 The modem will ignore busy tones, but waits for a dial tone before dialing. If a dial tone is not detected within 5 seconds, a NO DIAL TONE result code is returned. The modem returns a CONNECT xxxx result code when a connection is established, where xxxx is the Tx/Rx line speed. n=3 The modem will ignore dial tones. If a busy tone is detected, a BUSY result code is returned. Blind dialing is enabled. The modem returns a CONNECT xxxx result code when a connection is established, where xxxx is the Tx/Rx line speed. n=4 If a dial tone is not detected within 5 seconds, a NO DIAL TONE result code is returned. If a busy tone is detected, a BUSY result code is returned. The modem returns a CONNECT xxxx result code when a connection is established, where xxxx is the Tx/Rx line speed. 2001 MX-COM, Inc. www.mxcom.com Tel: 800 638 5577 336 744 5050 Fax: 336 744 5054 4800 Bethania Station Road, Winston-Salem, NC 27105-1201 USA Doc. # 208300157.001 All trademarks and service marks are held by their respective companies. Software & Hardware Description Comman d Zn &Fn &Gn 5.7 @Rn=x CMX868 & CMX867 Modem Design Guide Description Modem Reset Instructs the C to reset the CMX868 and then reload the factory S-Register settings (See S-Register Table). Syntax: ATZn Modifier Usage n=0 Reset CMX868 device and restore factory profile 0. n=1 Reset CMX868 device and restore factory profile 1. Recall Factory Defaults Instructs the C to reload the factory S-Register settings (See S-Register Table). Syntax: AT&Fn Modifier Usage n=0 Recalls factory profile 0. n=1 Recalls factory profile 1. Guard Tone Select Selects the Guard tone to be transmitted with highband QAM or DPSK. Syntax: AT&Gn Modifier Usage n=0 Disable guard tone (default). n=1 Select a 550Hz guard tone. n=2 Select a 1800Hz guard tone. CMX868 Specific AT Commands Comman d @RR @Rn? 21 of 24 Description CMX868 Device Reset Resets the CMX868 device. Syntax: AT@RR CMX868 Register Read Command for displaying the contents of a CMX868 device register Syntax: AT@Rn? where n is a valid CMX868 register address (hexadecimal). Value returned is in decimal format (i.e. 02356). CMX868 Register Write Command for writing to a CMX868 device register. Syntax: AT@Rn=x where n is a valid CMX868 register address (hexadecimal) and x is the value to be written (decimal). 8-bit register values should be between 0-255, while 16-bit register values should be between 065535. 2001 MX-COM, Inc. www.mxcom.com Tel: 800 638 5577 336 744 5050 Fax: 336 744 5054 4800 Bethania Station Road, Winston-Salem, NC 27105-1201 USA Doc. # 208300157.001 All trademarks and service marks are held by their respective companies. Software & Hardware Description 5.8 22 of 24 CMX868 & CMX867 Modem Design Guide S Registers S-register factory profiles are shown in the following table. Reg. Range Units S0 0-255 Rings S1 0-255 Rings S2 0-127 ASCII Decimal S3 0-127 ASCII Decimal S4 0-127 ASCII Decimal S5 0-127 ASCII Decimal S6 2-255 s S7 1-255 s S8 0-255 s S9 1-255 100ms S10 1-255 100ms S11 5-255 10ms S12 0-255 50ms 2001 MX-COM, Inc. Description Automatic answer - The number of rings until automatic answer. If the register is set to zero, modem does not answer. Count incoming rings - This register is read only and contains the number of rings detected by the modem. Escape character value - This register defines an ASCII decimal value of the escape character. The default setting is an ASCII + and the escape sequence is +++. A value over 127 disables the escape sequence. Carriage return character - Contains the ASCII decimal value of the character recognized as the command line terminator. This character will also be sent at the end of result codes. Linefeed character - Contains the ASCII decimal value of the character recognized as a linefeed. Backspace character - Contains the ASCII decimal value of the character recognized as a backspace. Wait time for blind dialing - Sets the length of time to pause after the modem goes off the hook before the modem dials the first digit of the telephone number. Wait for carrier after dial - Sets the length of time the modem waits for a carrier before returning on-hook. Pause Time for Comma Dial Modifier Specifies the number of seconds to pause for each comma (,) encountered in a dial string. Carrier Detect Response Time - Specifies the time that a received carried must be present on the line before the modem recognizes it as a valid carrier and asserts the Data Carrier Detect (DCD) signal. Lost carrier to hang up delay - Sets the length of time that the modem waits before hanging up after the loss of a carrier. This allows the modem to distinguish between disturbances that momentarily break the connection and when the remote modem hangs up. DTMF tone duration - Defines the duration of DTMF tones for tone dialing. The length of pause between each DTMF tone is the same as this duration time. Escape code guard time - Specifies the minimum time before entry of the escape sequence. This value also dictates the acceptable entry speed (inter-character time) for each escape character. Profile `0' (Default) 1 Profile `1' 0 0 43 43 13 13 10 10 8 8 2 2 50 50 2 2 6 6 7 7 10 20 20 20 www.mxcom.com Tel: 800 638 5577 336 744 5050 Fax: 336 744 5054 4800 Bethania Station Road, Winston-Salem, NC 27105-1201 USA 5 Doc. # 208300157.001 All trademarks and service marks are held by their respective companies. Software & Hardware Description 23 of 24 Reg. Description Range Units S13 S14 0-255 0-255 Decimal Decimal S16 S17 S18 0-255 0-255 0-255 Decimal Decimal s S19 S20 S21 S22 0-255 0-255 0-255 0-255 Decimal Decimal Decimal Decimal S23 0-255 Decimal S24 0-255 Decimal 2001 MX-COM, Inc. CMX868 & CMX867 Modem Design Guide Reserved General options - provides the following functions: 0 - Reserved 1 - Echo command character 0 Disables echoing (ATE0) 1 Enables echoing (ATE1) 2 - Result code display 0 Send responses (ATQ0) 1 Do not send responses (ATQ1) 3 - Word or number responses 0 Send number responses (ATV0) 1 Send word responses (ATV1) 4,5,6 - Reserved 7 - Answer/originate operation 0 Answer (ATA) 1 Originate (ATD) Reserved Reserved General Purpose Timer - Used for various firmware functions. Reserved Reserved Reserved Bit Mapped register - Provides the following functions: 0,1,2,3,7 - Reserved 6,5,4 - Calling Characteristics 000 (ATX0),100 (ATX1), 101 (ATX2), 110 (ATX3), 111(ATX4) Bit Mapped register - Provides the following functions: 0,1,2,3,4,5 - Reserved 6,7 - Guard tones 00 None (AT&G0) 01 550Hz (AT&G1) 10 1800Hz (AT&G2) Bit Mapped register - Provides the following functions: 0 - CMX868 Xtal Freq, 0 12.2880MHz, 1 11.0592MHz 1 - CMX868 Tx and Rx Fixed Compromise Equalizers (used during negotiation and data transfer), 0 Enable, 1 Disable 2, 3, 4, 5, 6, 7 - Reserved Profile `0' (Default) 0 138 Profile `1' 0 0 30 0 0 30 0 0 0 64 0 0 0 0 0 0 1 1 www.mxcom.com Tel: 800 638 5577 336 744 5050 Fax: 336 744 5054 4800 Bethania Station Road, Winston-Salem, NC 27105-1201 USA 0 128 Doc. # 208300157.001 All trademarks and service marks are held by their respective companies. Software & Hardware Description 24 of 24 Reg. Description Range Units S25 0-255 Decimal S26 0-255 Decimal S27 0-255 Decimal S28 S29 S30 S31 S32 0-255 0-255 0-255 0-255 0-255 Decimal Decimal Decimal Decimal Decimal S33 0-255 Decimal 2001 MX-COM, Inc. CMX868 & CMX867 Modem Design Guide Bit Mapped register - Provides the following functions: 0,1,2 - CMX868 Tx Gain (used during negotiation and data transfer), 111 0dB, 110 -1.5dB, 101 -3.0dB, 100 -4.5dB, 011 -6dB, 010 -7.5dB, 001 -9.0dB, 000 -10.5dB 3,4,5 - CMX868 Tx Data/Stop bits (used during data transfer) 111 8/2 bits, 110 8/1 bits, 101 7/2 bits, 100 7/1 bits, 011 6/2 bits, 010 6/1 bits, 001 5/2 bits, 000 5/1 bits 6,7 - CMX868 Tx Start-stop mode (used during data transfer) 00 Odd parity, 01 Even parity, 10 No parity Bit Mapped register - Provides the following functions: 0,1,2 - CMX868 Rx Gain (used during negotiation and data transfer) 111 0dB, 110 -1.5dB, 101 -3.0dB, 100 -4.5dB, 011 -6dB, 010 -7.5dB, 001 -9.0dB, 000 -10.5dB 3,4,5 - CMX868 Rx Data and Parity bits (used during data transfer) 111 8 data + parity, 110 8 data 101 7 data + parity, 100 7 data 011 6 data + parity, 010 6 data 001 5 data + parity, 000 5 data 6,7 - CMX868 Rx USART (used during data transfer) 00 2.3% over-speed 01 1% over-speed 10 No over-speed Bit Mapped register - Provides the following functions: 0,1,2,3 - Reserved. 4,5,6,7 - Communication Standard 0000 (ATB0), 0001 (ATB1) 0010 (ATB2), 0011 (ATB3) 0100 (ATB4), 0101 (ATB5) 0110 (ATB6), 0111 (ATB7) 1000 (ATB8), 1001 (ATB9) Reserved Reserved Reserved Reserved Xon Character. Contains the ASCII decimal value of the character recognized as Xon. Xoff Character. Contains the ASCII decimal value of the character recognized as Xoff. Profile `0' (Default) 176 Profile `1' 48 176 0 0 0 0 0 0 17 0 0 0 0 17 19 19 www.mxcom.com Tel: 800 638 5577 336 744 5050 Fax: 336 744 5054 4800 Bethania Station Road, Winston-Salem, NC 27105-1201 USA 176 Doc. # 208300157.001 All trademarks and service marks are held by their respective companies.